l=list(map(int,input().rstrip().split()))
main=l[0]
n=l[1]
sum=0
while main!=0:
main-=1
sum+=1
if sum%n==0:
main+=1
print(sum)
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
ll l, b, nl = 0, time = 0, n;
cin>>l>>b;
time += l;
nl += l;
while (true) {
if (nl/b > 0) {
time += nl/b;
n = nl;
nl -= (nl/b)*b;
nl += n/b;
}
else break;
}
cout<<time;
}
Almost correct bracket sequence | Count of integers |
Differences of the permutations | Doctor's Secret |
Back to School | I am Easy |
Teddy and Tweety | Partitioning binary strings |
Special sets | Smallest chosen word |
Going to office | Color the boxes |
Missing numbers | Maximum sum |
13 Reasons Why | Friend's Relationship |
Health of a person | Divisibility |
A. Movement | Numbers in a matrix |
Sequences | Split houses |
Divisible | Three primes |
Coprimes | Cost of balloons |
One String No Trouble | Help Jarvis! |
Lift queries | Goki and his breakup |